﻿using System;

namespace ShopHelper.Basic
{
    /// <summary>
    /// 响应的基础对象。
    /// </summary>
    public class ResponseObject
    {
        /// <summary>
        /// 错误码
        /// </summary>
        public String ErrCode { get; set; }

        /// <summary>
        /// 错误信息
        /// </summary>
        public String ErrMsg { get; set; }

        /// <summary>
        /// 子错误码
        /// </summary>
        public String SubErrCode { get; set; }

        /// <summary>
        /// 子错误信息
        /// </summary>
        public String SubErrMsg { get; set; }

        /// <summary>
        /// 响应原始内容
        /// </summary>
        public String Body { get; set; }

        /// <summary>
        /// 响应结果是否错误
        /// </summary>
        public Boolean IsError
        {
            get
            {
                return !string.IsNullOrEmpty(this.ErrCode) || !string.IsNullOrEmpty(this.SubErrCode);
            }
        }
    }
}
